package com.suncnpap.journal.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.app.util.database.mybatis.Page;
import com.suncnpap.journal.service.JournalRegistrationService;
import com.suncnpap.journal.mapper.JournalRegistrationMapper;
import com.suncnpap.journal.model.JournalRegistration;

/** 
 * 说明： 期刊登记Service实现类
 * @version
 */
@Service("journalRegistrationService")
public class JournalRegistrationServiceImpl implements JournalRegistrationService{

	
	@Autowired
	JournalRegistrationMapper journalRegistrationMapper;
	
	@Override
	public void add(JournalRegistration obj) {
		// TODO Auto-generated method stub
		journalRegistrationMapper.add(obj);
	}

	@Override
	public void update(JournalRegistration obj) {
		// TODO Auto-generated method stub
		journalRegistrationMapper.edit(obj);
	}

	@Override
	public void deleteById(String strId) {
		// TODO Auto-generated method stub
		journalRegistrationMapper.deleteById(strId);
		
	}
	@Override
	public void deleteMore(String[] strIds) {
		// TODO Auto-generated method stub
		journalRegistrationMapper.deleteMore(strIds);
	}

	@Override
	public Page list(Page page) {
		// TODO Auto-generated method stub
		List<JournalRegistration> list = journalRegistrationMapper.datalistPage(page);
		page.setDataList(list);
		return page;
	}


	@Override
	public int findCount(Page page) {
		// TODO Auto-generated method stub
		return journalRegistrationMapper.findCount(page);
	}

	@Override
	public JournalRegistration findById(String strId) {
		// TODO Auto-generated method stub
		return journalRegistrationMapper.findById(strId);
	}
	
	@Override
	public void updateBorrowById(String strBarcodeNumber, String strSchoolId){
		journalRegistrationMapper.updateBorrowById(strBarcodeNumber, strSchoolId);
	}
	
	@Override
	public void updateReturnById(String strBarcodeNumber, String strSchoolId){
		journalRegistrationMapper.updateReturnById(strBarcodeNumber, strSchoolId);
	}
	
	@Override
	public JournalRegistration findByBarcode(String strBarcode, String strSchoolId){
		return journalRegistrationMapper.findByBarcode(strBarcode, strSchoolId);
	}
	
}

